#include <iostream>
#include <string>
using namespace std;

struct Student
{
    double score;
};

struct People
{
    string name;
    int age;
    struct  Student student;
};

void print(Student student)
{
    student.score = 99.8;
    cout<<"该学生成绩为："<<student.score<<endl;
}

void print1(Student* student)
{
    student ->score = 99.8;
    cout<<"该学生成绩为："<<student->score<<endl;
}

//结构体作为函数参数传递
//1.值传递     2.地址传递
//值传递不改变原始数据，地址传递改变原始数据
void chuandizhi()
{
    //值传递；
    Student s = {78.5};
    print(s);
    cout<<s.score<<endl;

    //地址传递
    print1(&s);
    cout<<"地址传递："<<s.score;
}
